//************************************************************************
// author	:	vera												
// date		:	2011/4/3 1:28 					                 
//************************************************************************
#include "Node.h"
#include "Drawable.h"
namespace sl
{
	typedef std::vector< ref_ptr<Drawable> >		DrawableList;
	class SL_EXPORT GeoNode : public Node
	{
		public:
			GeoNode(void);
			~GeoNode(void);

			virtual bool AddDrawable( sl::Drawable * pDrawable );
			virtual bool RemoveDrawable( sl::Drawable * pDrawable );
			virtual	bool RemoveDrawable( u32 nIndex );
			
			virtual void Accept( sl::NodeVisitor * pNodeVisitor );
			virtual void Ascend( sl::NodeVisitor * pNodeVisitor );
			virtual void Traverse( sl::NodeVisitor * pNodeVisitor );

			virtual const std::string libraryname() { return "sl"; };
			virtual const std::string classname() { return "GeoNode"; };

			u32 GetDrawableNum() { return m_vDrawableList.size(); }
			sl::Drawable * GetDrawableWithPosition( u32 index ) { return m_vDrawableList[index].get(); }

		protected:

			DrawableList		m_vDrawableList;

		private:
			u32		getDrawableIndex( sl::Drawable * pDrawable );

	};

}
